package com.link.base.base.common.utils;

import com.link.base.core.apiutils.SpringPropertyUtil;
import com.link.core.util.StringUtils;

/**
 * 获取附件路径前缀
 *
 * @author daichenyu
 * @date 2019/2/25
 */
public class GetAttachPathUtil {

    public static String getAttachPath(String param) {
        String path = SpringPropertyUtil.getProperty("linkcrm.attachment.path");
        if (StringUtils.isNotBlank(param) && !param.startsWith("http")) {
            return path + param;
        } else if (StringUtils.isBlank(param)) {
            return path + "empty.jpg";
        } else {
            return param;
        }
    }

}
